class AddUserIdToTodos < ActiveRecord::Migration
  def self.up
    add_column :todos, :user_id, :integer, :null => false

    execute "alter table todos
      add constraint fk_todos_users
      foreign key (user_id) references users(id)"
  end

  def self.down
    remove_column :todos, :user_id
  end
end
